package ru.algorithm.join;

import ru.DoubleArrayReader;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;

import static ru.common.CommonUtils.iterable;

/**
 * Yuri Zemlyanskiy <urikz@yandex-team.ru>
 * Date: 05.05.2011
 */
public abstract class DataStreamAlgorithm {
    public abstract void process(InputStream input, OutputStream output);

    protected static Iterable<double[]> read(final InputStream input) {
        return iterable(new DoubleArrayReader(new BufferedReader(new InputStreamReader(input))));
    }

}
